package com.ml.mall.mapper;

import com.ml.mall.bean.res.purchase.PurchaseVariantQueryPageRes;
import com.ml.mall.bean.res.purchase.vo.PurchaseSupplierVO;
import com.ml.mall.bean.res.purchase.vo.PurchaseVariantVO;
import com.ml.mall.bean.vo.DateValueVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by kyyang on 2021/7/4 12:39
 */
@Repository
public interface AnalyticsPurchaseMapper {

    /**
     * @description: 按照卖家 top N
     * @author kyyang
     * @date 2021/7/4 12:47
     * @version 1.0
     */
    List<PurchaseSupplierVO> selectSalesBySupplierTopN(@Param("topN") int topN, @Param("startTime") String timeBegin, @Param("endTime") String timeEnd, @Param("companyId") Long companyId);

    /**
     * @description:  按照variant top N
     * @author kyyang
     * @date 2021/7/4 13:39
     * @version 1.0
     */
    List<PurchaseVariantVO> selectSalesByVariantTopN(@Param("topN") int topN, @Param("startTime") String timeBegin, @Param("endTime") String timeEnd, @Param("companyId") Long companyId);

    /**
     * @description: 分类 top N
     * @author kyyang
     * @date 2021/7/4 14:16
     * @version 1.0
     */
    List<DateValueVO> selectPurchaseSpentQueryReportByCategoryTopN(@Param("topN") int topN, @Param("startTime") String timeBegin, @Param("endTime") String timeEnd, @Param("companyId") Long companyId);

    /**
     * @description: 买家中 卖家 top N
     * @author kyyang
     * @date 2021/7/4 14:43
     * @version 1.0
     */
    List<DateValueVO> selectPurchaseSupplierQueryReport(@Param("topN") int topN, @Param("startTime") String timeBegin, @Param("endTime") String timeEnd, @Param("companyId") Long companyId);

    /**
     * @description: 消费订单的卖家 分页查询 总记录数
     * @author kyyang
     * @date 2021/7/4 14:55
     * @version 1.0
     */
    Integer selectPurchaseSupplierQueryPageCount(@Param("startTime") String timeBegin, @Param("endTime") String timeEnd,@Param("supplierCode") String supplierCode,@Param("companyId") Long companyId);

    /**
     * @description: 消费订单的卖家 分页查询 记录明细
     * @author kyyang
     * @date 2021/7/4 14:58
     * @version 1.0
     */
    List<PurchaseSupplierVO> selectPurchaseSupplierQueryPageList(@Param("startTime") String timeBegin, @Param("endTime")String timeEnd,@Param("sortType") int sortType,@Param("supplierCode") String supplierCode,@Param("start") int start,@Param("end") int end,@Param("companyId") Long companyId);

    /**
     * @description: 分页查询买家消费产品 总记录数
     * @author kyyang
     * @date 2021/7/4 15:11
     * @version 1.0
     */
    Integer selectPurchaseVariantQueryPageCount(@Param("startTime") String timeBegin, @Param("endTime") String timeEnd,@Param("supplierCode") String supplierCode,@Param("companyId") Long companyId,@Param("categoryId") String categoryId,@Param("variantName") String variantName);

    /**
     * @description: 分页查询买家消费产品 总记录明细
     * @author kyyang
     * @date 2021/7/4 15:18
     * @version 1.0
     */
    List<PurchaseVariantQueryPageRes> selectPurchaseVariantQueryPageList(@Param("startTime") String timeBegin, @Param("endTime")String timeEnd,@Param("sortType") int sortType,@Param("supplierCode") String supplierCode,@Param("start") int start,@Param("end") int end,@Param("companyId")  Long companyId,@Param("categoryId") String categoryId,@Param("variantName") String variantName);
}
